<?php

include_once 'submitemail.php';
include_once 'conf/db-config.php';

$name = addslashes($_REQUEST['name']);
$emailId = $_REQUEST['email'];
$subject = addslashes($_REQUEST['subject']);
$message = addslashes($_REQUEST['message']);

//$mailTo = "topmbaconsultant@ymail.com";
$mailTo = "avik.kundu@icteas.com";
if(strlen($emailId)>0  && strlen($message)>0)
{
	$run = mysql_query("INSERT INTO tbl_contact_request (email_id,contact_name,subject,message,contact_date)
	VALUES ('".$emailId."','".$name."','".$subject."','".$message."',now()) ");
}
if($run)
{
	GENERATE_SMTP_MAIL($mailTo, $emailId, $name, $cc='', $bcc='', $subject , $message);
}
?>
<script>
window.open('contact-us.php?message=success','_self');
</script>
<?php 

/*
 * CREATE TABLE `mymba`.`tbl_contact_request` (
  `id` INTEGER UNSIGNED NOT NULL AUTO_INCREMENT,
  `email_id` VARCHAR(500),
  `contact_name` VARCHAR(500),
  `subject` VARCHAR(500),
  `message` TEXT,
  `contact_date` DATETIME,
  PRIMARY KEY (`id`)
)
ENGINE = InnoDB;
 * 
